package com.example.litterpainterdemo.utils

import android.content.Context
import android.util.TypedValue
import android.view.View

fun View.dp2px(dp:Int): Float {
    return resources.displayMetrics.density*dp
}

fun Context.dp2px(dp:Int): Float {
    return resources.displayMetrics.density*dp
}

fun Context.sp2px(sp:Float):Float{
    return  TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,resources.displayMetrics)
}